<?php

// Update after deployment for location of non-public files
$root = dirname(dirname(__FILE__));

// Setup the include path to include zend and the application
set_include_path(
    $root . '/application/'         . PATH_SEPARATOR .
    $root . '/application/models/'  . PATH_SEPARATOR .
    $root . '/application/plugins/' . PATH_SEPARATOR .
    $root . '/library/' 			. PATH_SEPARATOR .
    get_include_path()
);

/*
// Use the autoloader
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
*/

// TODO: The new version of zend has a application class that has build in bootstrapping
// We should move to this instead.
// http://akrabat.com/2009/03/25/initial-notes-on-zend_application/
// http://www.nabble.com/Replacing-Zend_Loader-by-Zend_Loader_Autoloader-td23256407.html

require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true);

// Initialize the application using the plugin
$front = Zend_Controller_Front::getInstance();
$front->registerPlugin(new InitializerPlugin('production'));

// Dispatch and respond
$front->dispatch()->sendResponse();
?>